package com.meko.tms.data.service.impl.tms;

import com.meko.tms.crud.service.impl.OriginTmsServiceImpl;
import com.meko.tms.data.bean.OriginTmsData;
import com.meko.tms.core.service.IncrementalAdditionDataService;
import java.util.List;

import com.meko.tms.crud.mapper.OriginTmsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/***
 * @ClassName     IncrementalAdditionDataServiceImpl
 * @Description   TODO 数据插入
 * @Author        meko
 * @Date       2022/01/11 下午 08:37
 * @version:      1.0
 */
@Slf4j
@Service
public class TmsIncrementalAdditionDataServiceImpl implements IncrementalAdditionDataService<OriginTmsData> {

    private final OriginTmsServiceImpl originTmsService;

    public TmsIncrementalAdditionDataServiceImpl(OriginTmsServiceImpl originTmsService) {
        this.originTmsService = originTmsService;
    }

    @Override
    public boolean incrementalAdditionData(List<OriginTmsData> list) {
        if (list == null || list.size() == 0){
            log.info("数据为null");
            return false;
        }
        originTmsService.saveOrUpdateBatch(list);
        return true;
    }
}
